package com.candy.candymessage.business.controller;

import com.candy.candymessage.business.feign.LogService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author suYanLong
 * @date 2023年02月08日 14:24
 */
@RestController
@Slf4j
public class DubboLogController {

    @GetMapping("test5")
    public String run(@RequestParam("name") String name) throws Exception {
        log.info("message receive name : " + name);
        return "hello :" + name;
    }

    @Autowired
    LogService logService;

    @GetMapping("saveLog")
    public String saveLog(@RequestParam("logStr") String logStr) throws Exception {
        log.info("message receive name : " + logStr);
        return logService.saveLog(logStr);
    }

}
